#include "ocrfont8.h"
#include <nds.h>

using namespace WoopsiUI;

static const u16 OCRFont8_glyphdata[195] = {
/* '!' */	0xF400,
/* '"' */	0xF990,0x0000,
/* '#' */	0x6F6F,0x6000,
/* '$' */	0x27E1,0xF0FC,0x8000,
/* '%' */	0x9224,0x4900,
/* '&' */	0x04A4,0xB700,
/* ''' */	0xE000,
/* '(' */	0x6A90,
/* ')' */	0x9560,
/* '*' */	0x255D,0x5200,0x0000,
/* '+' */	0x213E,0x4200,0x0000,
/* ',' */	0x0072,0x4000,
/* '-' */	0x000F,0x0000,
/* '.' */	0x0800,
/* '/' */	0x1224,0x4800,
/* '0' */	0xF999,0x9F00,
/* '1' */	0xE108,0x52FC,0x0000,
/* '2' */	0xF11F,0x8F00,
/* '3' */	0xD570,
/* '4' */	0x96F2,0x4000,
/* '5' */	0x7447,0x1F00,
/* '6' */	0x888F,0x9F00,
/* '7' */	0xF842,0x6210,0x0000,
/* '8' */	0x497B,0xC000,
/* '9' */	0xF9F1,0x1100,
/* ':' */	0x2800,
/* ';' */	0x1072,0x4000,
/* '<' */	0x0168,0x6100,
/* '=' */	0x00F0,0xF000,
/* '>' */	0x0861,0x6800,
/* '?' */	0x3D24,0x0400,
/* '@' */	0xE97B,0xB500,
/* 'A' */	0x6669,0xF900,
/* 'B' */	0xE9E9,0x9E00,
/* 'C' */	0x3488,0x4300,
/* 'D' */	0xE555,0x5E00,
/* 'E' */	0xF8E8,0x8F00,
/* 'F' */	0xF8E8,0x8800,
/* 'G' */	0x348B,0x9F00,
/* 'H' */	0x99F9,0x9900,
/* 'I' */	0xF908,0x427C,0x0000,
/* 'J' */	0x24DA,0x8000,
/* 'K' */	0x9ACA,0xA900,
/* 'L' */	0x8888,0x8F00,
/* 'M' */	0x9FD9,0x9900,
/* 'N' */	0x9DDB,0xB900,
/* 'O' */	0x6999,0x9600,
/* 'P' */	0xE99E,0x8800,
/* 'Q' */	0x359B,0xAF00,
/* 'R' */	0xE9FA,0xA900,
/* 'S' */	0xE942,0x9700,
/* 'T' */	0xFD48,0x4210,0x0000,
/* 'U' */	0x9999,0x9F00,
/* 'V' */	0x9999,0x6600,
/* 'W' */	0x8C6B,0x5AA8,0x0000,
/* 'X' */	0x9666,0x6900,
/* 'Y' */	0x8A88,0x4210,0x0000,
/* 'Z' */	0xF224,0x4F00,
/* '[' */	0xFAAA,0xAF00,
/* '\' */	0x8442,0x2100,
/* ']' */	0xF555,0x5F00,
/* '^' */	0x0466,0x9000,
/* '_' */	0x0000,0x0003,0xE000,
/* '`' */	0xC000,
/* 'a' */	0x0061,0xFF00,
/* 'b' */	0x88E9,0x9E00,
/* 'c' */	0x0078,0x8700,
/* 'd' */	0x1179,0x9700,
/* 'e' */	0x007F,0x8700,
/* 'f' */	0x34E4,0x4400,
/* 'g' */	0x0799,0x71F0,
/* 'h' */	0x88E9,0x9900,
/* 'i' */	0x4325,0xC000,
/* 'j' */	0x2192,0x4F00,
/* 'k' */	0x889E,0xA900,
/* 'l' */	0xC925,0xC000,
/* 'm' */	0x0035,0x5AD4,0x0000,
/* 'n' */	0x00E9,0x9900,
/* 'o' */	0x0069,0x9600,
/* 'p' */	0x0E99,0xE880,
/* 'q' */	0x0799,0x7110,
/* 'r' */	0x00E9,0x8800,
/* 's' */	0x00FC,0x3E00,
/* 't' */	0x04E4,0x5200,
/* 'u' */	0x0099,0x9700,
/* 'v' */	0x0099,0x6600,
/* 'w' */	0x0023,0x5AA8,0x0000,
/* 'x' */	0x0096,0x6900,
/* 'y' */	0x16B4,0xB000,
/* 'z' */	0x00F2,0x4F00,
/* '{' */	0x1930,0x420C,0x0000,
/* '|' */	0xFC00,
/* '}' */	0xC106,0x4260,0x0000,
/* '~' */	0x0070,0x0000,
/* 0x7F */	0xF999,0x9F00,
};

static const u16 OCRFont8_offset[95] = {
    0,    1,    3,    5,    8,   10,   12,   13,   14,   15,   18,   21,   23,   25,   26,   28,
   30,   33,   35,   36,   38,   40,   42,   45,   47,   49,   50,   52,   54,   56,   58,   60,
   62,   64,   66,   68,   70,   72,   74,   76,   78,   81,   83,   85,   87,   89,   91,   93,
   95,   97,   99,  101,  104,  106,  108,  111,  113,  116,  118,  120,  122,  124,  126,  129,
  130,  132,  134,  136,  138,  140,  142,  144,  146,  148,  150,  152,  154,  157,  159,  161,
  163,  165,  167,  169,  171,  173,  175,  178,  180,  182,  184,  187,  188,  191,  193
};

static const u8 OCRFont8_width[95] = {
 1, 4, 4, 5, 4, 4, 1, 2, 2, 5, 5, 3, 4, 1, 4, 4,
 5, 4, 2, 3, 4, 4, 5, 3, 4, 1, 3, 4, 4, 4, 4, 4,
 4, 4, 4, 4, 4, 4, 4, 4, 5, 3, 4, 4, 4, 4, 4, 4,
 4, 4, 4, 5, 4, 4, 5, 4, 5, 4, 4, 4, 4, 4, 5, 2,
 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 4, 3, 5, 4, 4, 4,
 4, 4, 4, 4, 4, 4, 5, 4, 3, 4, 5, 1, 5, 3, 4
};

OCRFont8::OCRFont8(u8 fixedWidth) : PackedFont1 (
	33,
	127,
	OCRFont8_glyphdata,
	OCRFont8_offset,
	OCRFont8_width,
	8,
	2,
	5,
	5
) {
	if (fixedWidth) setFontWidth(fixedWidth);
};
